package com.yc.cloud.openai.enums;

import com.yc.cloud.basic.enums.IEnumCode;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CozeGrantTypeEnums implements IEnumCode {

    AUTHORIZATION_CODE("authorization_code", "授权码"),
    REFRESH_TOKEN("refresh_token", "刷新令牌"),
    JWT_BEARER("jwt", "JWT授权");

    /**
     * 状态码
     */
    final String code;
    /**
     * 消息内容
     */
    final String description;

    public static boolean isValidEnum(String code) {
        for (CozeGrantTypeEnums type : CozeGrantTypeEnums.values()) {
            if (type.code.equals(code)) {
                return true;
            }
        }
        return false;
    }
}
